package com.thoughtworks.studio.tools.cardkit;

import java.util.Properties;

import com.thoughtworks.studio.tools.cardkit.generator.CardImageGenerator;

public class Card {
	private Properties prop = new Properties();
	private CardImageGenerator generator;
	private String number;
	private String name;	
	public void setPorperty(String name,Object value){
		prop.put(name, value);
	}
	public void setNumber(String cardNumber) {
		this.number = cardNumber;
	}
	public void setName(String cardName) {
		this.name = cardName;
	}
	public String getNumber() {
		return number;
	}
	public String getName() {
		return name;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((number == null) ? 0 : number.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Card))
			return false;
		final Card other = (Card) obj;
		if (generator == null) {
			if (other.generator != null)
				return false;
		} else if (!generator.equals(other.generator))
			return false;
		if (number == null) {
			if (other.number != null)
				return false;
		} else if (!number.equals(other.number))
			return false;
		return true;
	}
	public CardImageGenerator getGenerator() {
		return generator;
	}
	public void generate(){
		generator.generate(this);
	}
}
